<?php
    include ($_SERVER["DOCUMENT_ROOT"].'/CTAN/models/NgheSi.php');
    $nghesi = new NgheSi();
    $isLogedIn = isset($_REQUEST['login']) && ($_REQUEST['login'] == 'true');
    $result=$nghesi->danhSachNgheSi($isLogedIn);
    while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
         $danhSach[]=array(
            'id' => $row['ma_nghe_si'],
            'tenthat' => $row['ten_that'],
            'nghedanh' => $row['nghe_danh'],
            'ngaysinh' => $row['ngay_sinh'],
            'tieusu' => $row['tieu_su'],
            'conhoatdong' => $row['con_hoat_dong'],
            'like' => $row['luot_like']
        );
    }
    $nghesi->closeConnection();
    echo json_encode($danhSach,JSON_UNESCAPED_UNICODE);
?>
